<?php

// No direct access

defined('_JEXEC') or die('Restricted access');

$document = &JFactory::getDocument();

JHTML::_('behavior.mootools');

//load OpenLayers
$document->addScript('http://openlayers.org/api/OpenLayers.js');
//load OpenStreetMap & Yahoo maps
$document->addScript('http://www.openstreetmap.org/openlayers/OpenStreetMap.js');
$document->addScript('http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers');
//load custom map
$document->addScript(JPATH_COMPONENT.DS.'views'.DS.'worldmap'.DS.'tmpl'.DS.'worldmap.js');

//debug-only: remove before deploy
$document->addScript(JPATH_COMPONENT.DS.'views'.DS.'worldmap'.DS.'tmpl'.DS.'debug.js');

$loader = '
            window.addEvent(\'domready\', function(){
    testLoop()
  });
';
$document->addScriptDeclaration($loader);

?>
<h1><?php echo $this->dataToDisplay; ?></h1>
<h2>test</h2>
<?php

$basepath = split('/',JPATH_COMPONENT);
print_r($basepath);

$path = 'http://localhost:8888/'.$basepath[4].DS.$basepath[5].DS.$basepath[6].DS;

?>
<?php echo '<iframe src='.$path.'views'.DS.'worldmap'.DS.'tmpl'.DS.'map.html></iframe>' ?>
<div id="map" class="smallmap">
    <script type="text/javascript"> testLoop(); </script>
</div>



